<div class="pageContent">
        <if condition="isset($admin)">
            <form method="post" action="__URL__/update" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone);">
        <else />
            <form method="post" action="__URL__/insert" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone);">
        </if>

        <div class="pageFormContent" layoutH="56">
            <div style="width:100%;float:left;">
                <label style="font-size:12px;margin-left:10px;">姓名：</label>
                <input name="name" type="text" size="30" value="{$admin.name}" class="required"/>
            </div>
            <div style="margin-top: 10px;width:100%;float:left;">
                <label style="font-size:12px;margin-left:10px;">登录帐号：</label>
                <input name="admin_name" type="text" size="30" value="{$admin.admin_name}" class="required alphanumeric"/>
            </div>
            <div style="margin-top: 10px;width:100%;float:left;">
                <label style="font-size:12px;margin-left:10px;">邮箱：</label>
                <input name="admin_email" type="text" size="30" value="{$admin.admin_email}" class="required email"/>
            </div>
            <div style="margin-top: 10px;width:100%;float:left;">
                <label style="font-size:12px;margin-left:10px;">请指定密码：</label>
                <input name="admin_pass" type="password" size="30" value="" class="alphanumeric"/>
            </div>
            <div style="margin-top: 10px;width:100%;float:left;">
                <label style="font-size:12px;margin-left:10px;">重复密码：</label>
                <input name="repassword" type="password" size="30" value="" class=""/>
            </div>                    
           <div style="width:100%;float:left;">
                <div style="width:140px;margin-top:15px;">
                    <label style="font-size:12px;margin-left:10px;">所属岗位：</label>
               </div>
               <select id="all1" size="10" multiple="multiple" style="width:100px;float:left;">
                    <volist name="groupsList" id="group">
                        <option value="{$key}" selected='true'>
                            {$group}
                        </option>
                    </volist>
               </select>
               <div style="float:left;width:36px;margin-top: 40px;">
                   <input type="button" value=">" class="LToR" k="1" style="float:left;margin-left: 6px;"/>
                   <input type="button" value="<" class="RToL" k="1" style="float:left;margin-left: 6px;"/>
                   <input type="button" value=">>" class="LToRAll" k="1" style="float:left;"/>
                   <input type="button" value="<<" class="RToLAll" k="1" style="float:left;"/>
               </div>
                <select id="sel1" size="10" multiple="multiple" style="width:100px;float:left;">0
                <if condition="isset($gList)">
                    <volist name="gList" id="g">
                        <option value="{$key}" selected='true'>
                            {$g}
                        </option>
                    </volist>
                </if>
                </select>
           </div>
        </div>
        <div class="formBar">        
        <ul>
            <if condition="in_array('update', $privilegelist)">
            <li>
                <div class="buttonActive">
                    <div class="buttonContent">
                        <input type="hidden" name="admin_id" value="{$admin.admin_id}"/>
                        <input type="hidden" id="groupinfo" name="gids" value="{$admin.group_id}"/>
                        <button type="submit">保存</button>

                    </div>
                </div>
            </li>
            <li>
                <div class="button">
                    <div class="buttonContent">
                        <button type="button" class="close">取消</button>
                    </div>
                </div>
            </li>
            </if>
        </ul>
        </div>
    </form>
</div>
     <script type="text/javascript">
        $(function () {
            $(".LToR").click(function () {
                var k = $(this).attr('k');
                $("#all"+k+" option:selected").appendTo($("#sel"+k)); //从左到右
                sbt();
            })

            $('.RToL').click(function () {
                var k = $(this).attr('k');
                $('#sel'+k+' option:selected').appendTo($('#all'+k)); //从右到左
                sbt();
            });

            $('.LToRAll').click(function () {
                var k = $(this).attr('k');
                $("#all"+k+" option").appendTo($("#sel"+k)); //从左到右全部
                sbt();
            });

            $('.RToLAll').click(function () {
                var k = $(this).attr('k');
                $("#sel"+k+" option").appendTo($("#all"+k)); //从左到右全部
                sbt();
            });

            function sbt() {
                var group_config='';
                $('#sel1 option').each(function () {
                    var cheVal = $(this).val();
                    group_config += cheVal+',';
                });

                $('#groupinfo').val(group_config);
            }
        })
    </script>